#!/bin/sh

[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
[ "$ACTION" = ifupdate -a -z "$IFUPDATE_ADDRESSES" -a -z "$IFUPDATE_DATA" ] && exit 0

/etc/init.d/mptcp enabled || exit 0

if [ -z "$(echo $DEVICE | grep oip | grep gre)" ]; then
	logger -t "mptcp" "Reloading mptcp config due to $ACTION of $INTERFACE ($DEVICE)"
	/etc/init.d/mptcp reload "$DEVICE" >/dev/null || exit 0
else
	multipath $DEVICE off 2>&1 >/dev/null
fi

